import configparser
from public import singletone

# 实现一个公共类
@singletone
class ConfigManager:
    def __init__(self, config_file='./config3.ini'):
        self.config = configparser.ConfigParser()
        self.config.read(config_file)

    def get(self, section, key):
        if section in self.config and key in self.config[section]:
            return self.config[section][key]
        return None

if __name__ == "__main__":
    config_manager = ConfigManager()
    value = config_manager.get('browser', 'driver_path')
    print(value)  # 输出：value1